package com.csy.commons.core.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * 基本实体类
 * @author Wu.Liang
 * @date 2025年6月6日
 */
public class BaseEntity implements Serializable {
    private static final long serialVersionUID = 8025610044215917786L;

    /**
     * 搜索值
     */
    @TableField(exist = false) //表示不属于数据库字段，mybatis在新增的时候会忽略该字段
    private String searcheValue;
    /**
     * 请求参数，
     * map集合<key,value>接受前端发送来的数据，
     * 数据是封装成JSON格式，它的params就是key
     */
    @TableField(exist = false)
    private Map<String, Object> params;

    /* 创建者*/
    @TableField(fill = FieldFill.INSERT)    //标明该字段在什么时候需要被填充
    private String createBy;

    /* 创建时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)    //标明该字段在什么时候需要被填充
    private Date createTime;

    /* 更新者*/
    @TableField(fill = FieldFill.INSERT_UPDATE)    //标明该字段在什么时候需要被填充
    private String updateBy;

    /* 更新时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)    //标明该字段在什么时候需要被填充
    private Date updateTime;

    /* 备注*/
    private String remark;

    @TableField(exist = false)
    private String beginTime;

    @TableField(exist = false)
    private String endTime;

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getSearcheValue() {
        return searcheValue;
    }

    public void setSearcheValue(String searcheValue) {
        this.searcheValue = searcheValue;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }


    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
